#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 1e6 + 5;

ll n;
int np[N];
vector<ll> primes;
void init_primes(int n) {
  np[1] = 1;
  for (int i = 2; i < n; i++) {
    if (!np[i]) primes.push_back(i);
    for (ll j : primes) {
      ll k = j * i;
      if (k > n) break;
      np[k] = 1;
      if (i % j == 0) break;
    }
  }
}
ll solve_8(ll n) {
  ll res = 0;
  for (ll x : primes) {
    x *= x;
    x *= x;
    x *= x;
    if (x > n) break;
    res++;
  }
  return res;
}
ll solve_2(ll n) {
  if (primes.size() < 2) return 0;
  for (ll& x : primes) x *= x;
  ll res = 0;
  rep(i, 0, primes.size() - 1) {
    ll x = primes[i];
    ll y = n / x;
    if (y < x) break;
    int cnt =
        upper_bound(primes.begin(), primes.end(), y) - (primes.begin() + i + 1);
    res += cnt;
  }
  return res;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  init_primes(1000000);
  cin >> n;
  ll x = solve_8(n);
  ll y = solve_2(n);
  cout << x + y;
  return 0;
}